<?php
	class Searchmodel extends CI_Model{
		
		public function item($value,$start,$pageSize){
			$sql="select top ".$pageSize." * from gm_user where username like '%$value%' or province like '%$value%'";
			$rs = $this->db->query($sql)->result_array();			
			return $rs;
		}

		public function getNum($value){
			$sql = "select count(*) from gm_user where username like '%$value%' or province  like '%$value%'";
			$rs = $this->db->query($sql)->row_array();
			return $rs['count(*)'];
		} 
	} 
?>